Repository navigation
fix: share the EP tutorial centre and implement width regression - #75
Merged
Merged
Conversation
Contributor
Author
|
|
Smoke run 39055282617 failed on 3.12 and 3.13: tutorial_6_gradients.py needs nautilus, a PyAutoFit optional dependency the base install omits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qy3Nc9rZwKHwQgPt8kMyeD
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tutorial 5 declared a shared centre but assigned independent priors, and its regression factor returned constant -1. Assign the same centre prior to every profile and replace the placeholder with a Gaussian width-relation density. The tutorial now checks that every dataset/regression factor actually updated, and smoke CI runs it with real sampling.
Closes #73.
Scripts Changed
scripts/chapter_advanced/tutorial_5_expectation_propagation.py: shared centre; explicit FWHM collection; Gaussian width relation; explanation of the modelling assumption and rejected projections; stale-factor guard.config/build/no_run.yaml: remove the obsolete exclusion.config/build/profile_smoke.yaml: use PYAUTO_TEST_MODE=0 for this tutorial so constant likelihoods cannot hide behind sampler bypass.Modelling choice for review
The formerly unexplained regression is now explicitly a teaching assumption: FWHM_i scatters around m*i+c, using dataset index i=0,1,2 and fixed scatter 5 pixels. These are inferred widths, not invented extra observations. The c prior is centred on FWHM(sigma=10), with sigma=10 pixels; m has mean=0 and sigma=5. The author should review whether this is the desired pedagogical example. Five sweeps demonstrate updates, not guaranteed convergence. No upstream library API change.
Validation
git diff --checkpassed.release validation stale: source moved since rehearsal (PyAutoFit, PyAutoGalaxy, PyAutoLens). No release claimed.Part of four authorized linked teaching tasks. Stop at human review; no merge authorization. Runtime-guidance PR #74 is independent; this PR starts from main.
CI prerequisite found during validation
Both Python 3.12 and 3.13 smoke jobs on the runtime-only PR #74 fail because BlackJAX is absent for gradient tutorials 6/7. Add the already-declared
blackjax>=1.6.2dependency to the workspace-owned.github/scripts/smoke_install.sh; no workflow or Python-matrix change. The two tutorials pass locally with this dependency installed. This prerequisite belongs here with restoration of smoke coverage; #74 should be revalidated after this PR lands.